 <h3><a href="/event/admin">Quản lý sự kiện</a></h3>
  <SCRIPT LANGUAGE="JavaScript">
function checkAll(a)
{   
    if(a==true){
        for(i=0;i<10;i++){
          document.getElementById("checkbox"+i).checked=true;              
        }
    }else{
           for(i=0;i<10;i++){
          document.getElementById("checkbox"+i).checked=false;              
        }
    }
}
 function addAction(action){
 switch(action){
     case "deleteEvent" :
        if(!confirm("Đây là thao tác không thể khôi phục lại. Bạn có chắc chắn thực hiện")){
             return false;          
        }else{
            document.getElementById("action1").value=action;
        }
        break;     
     case "changePromote" :
            document.getElementById("action1").value=action;
        break;
     case "changeCategory" :
            document.getElementById("action1").value=action;
        break;
 }  
 }
</script>
<?php 
                    $errors = $this->err;
                    if(is_array($errors) && count($errors)>0){
                    ?>
                    <ul  style="margin: 5px 60px 5px 140px; color: red;">
                    <?php 
                        foreach($errors as $err){
                    ?>
                        <li style="margin-left:10px;"><?php echo $err;?></li>
                    <?php 
                        }
                    ?>
                                        </ul>
                    <?php 
                    }
                    ?>

    <form name="search_form" method="post" >
   <strong>Tìm kiếm :</strong></br>
   Event ID:<input name="eid" style="width: 80px;" value="<?=$this->search['eid']?>">
   Tên sự kiện :<input name="event_name" value="<?=$this->search['event_name']?>">
   Người đăng(UID):<input name="uid" style="width: 80px;" value="<?=$this->search['uid']?>">
   Trạng thái:<select name="published">
                        <option value="2"  >Tất cả</option>
                        <option value="0" <?if($this->search['published']=="0") echo "selected='selected'";?>>Chưa được duyệt</option>
                        <option value="1" <?if($this->search['published']=="1") echo "selected='selected'";?>>Đã được duyệt</option>
                        
   </select>
   Hiển thị :<select name="promote">
   <option value="">Tất cả</option>
   <option value="<?=EVENT_PROMOTE_NOTPUBLISHED?>" <?if($this->search['promote']==EVENT_PROMOTE_NOTPUBLISHED && $this->search['promote']!="") echo "selected='selected'";?>>Không hiển thị</option> 
   <option value="<?=EVENT_PROMOTE_PUBLISHED?>" <?if($this->search['promote']==EVENT_PROMOTE_PUBLISHED) echo "selected='selected'";?>>Hiển thị</option> 
   <option value="<?=EVENT_PROMOTE_HOT?>" <?if($this->search['promote']==EVENT_PROMOTE_HOT) echo "selected='selected'";?>>Nổi bật</option> 
   <option value="<?=EVENT_PROMOTE_VIP?>" <?if($this->search['promote']==EVENT_PROMOTE_VIP) echo "selected='selected'";?>>VIP</option> 
   <option value="<?=EVENT_PROMOTE_FOCUS?>" <?if($this->search['promote']==EVENT_PROMOTE_FOCUS) echo "selected='selected'";?>>Tiêu điểm</option> 
   </select></br>
   Chuyên mục :<select name="cid"><option value="">Tất cả</option>
                                    <?
                                    foreach($this->category as $c){
                                    ?>
                                    <option value="<?=$c->tid?>" <?if($this->search['cid']==$c->tid) echo "selected='selected'";?> ><?=$c->name?></option>
                                    <?    
                                    }
                                    ?>
        </select>
   </br>
   <input type="submit" value="Tìm">

 <?=$this->htmlEventList?>
<strong>Với những sự kiện được chọn</strong> 
<table>
    <tr>
        
        <td>Chuyển trạng thái<select name="select_published">
                            <option value="1">Đã được duyệt</option>
                            <option value="0">Chưa được duyệt</option>
                            </select></br>
        Kiểu hiện thị <select name="select_promote"><option value="<?=EVENT_PROMOTE_PUBLISHED?>">Hiển thị</option>
                                <option value="<?=EVENT_PROMOTE_NOTPUBLISHED?>">Không hiển thị</option>
                                <option value="<?=EVENT_PROMOTE_HOT?>">Nổi bật</option>
                                <option value="<?=EVENT_PROMOTE_FOCUS?>">Tiêu điểm</option>
                                </select></br>
        <input type="submit" value="Thực hiện" onclick="addAction('changePromote');"></td>
        <td>Chuyển chuyên mục : <select name="select_category">
                                    <?
                                    foreach($this->category as $c){
                                    ?>
                                    <option value="<?=$c->tid?>"><?=$c->name?></option>
                                    <?    
                                    }
                                    ?>
        </select></br>
        <input type="submit" value="Thực hiện" onclick="addAction('changeCategory');"></td>       
        </td>
        <td width="300px"  align="right"><input type="submit" value="Xóa sự kiện" onclick="return addAction('deleteEvent');"></td> 
        <input type="hidden" name="action1" id="action1">
    </tr>
</table>
   </form>